import RequsetHttp from '@/utils/http'
import {
  SearchParams,
  ListResult,
  IdParams,
  BatchIdParams,
} from './model/operationModel'

enum Api {
  index = '/api/sysOperationLog/index',
  destroy = '/api/sysOperationLog/destroy',
  batchDestroy = '/api/sysOperationLog/batchDestroy',
  clean = '/api/sysOperationLog/clean',
}

export const getList = (params?: SearchParams) => {
  return RequsetHttp.get<ListResult>(Api.index, params)
}

export const destroy = (params: IdParams) => {
  return RequsetHttp.delete(Api.destroy, params)
}

export const batchDestroy = (params: BatchIdParams) => {
  return RequsetHttp.delete(Api.batchDestroy, params)
}

export const clean = () => {
  return RequsetHttp.delete(Api.clean)
}
